import request from "@/utils/request";

/**
 * 查询全部
 */
export function selectAll() {
    return request({
        url: "/api/menu/selectAll",
        method: "get",
    });
}

/**
 * 根据id查询子节点
 */
export function getChildMenu(params) {
    return request({
        url: "/api/menu/getMenuListByPid",
        method: "get",
        params,
    });
}

/**
 * 查询树形数据
 */
export function getTreeMenu() {
    return request({
        url: "/api/menu/getTreeMenu",
        method: "get",
    });
}

/**
 * 查询菜单分页数据
 */
export function selectPage(params) {
    return request({
        url: "/api/menu/selectPage",
        method: "get",
        params,
    });
}
/**
 * 新增菜单
 */
export function addMenu(data) {
    return request({
        url: "/api/menu/insert",
        method: "post",
        data,
    });
}
/**
 * 删除菜单
 */
export function deleteMenu(params) {
    return request({
        url: "/api/menu/delete",
        method: "delete",
        params,
    });
}
/**
 * 更新菜单
 */
export function updateMenu(data) {
    return request({
        url: "/api/menu/update",
        method: "put",
        data,
    });
}
